﻿function GongZuoJiHua(model) {
    return {
        mbid: model ? model.mbid : 0,
        mbmc: model ? model.mbmc : "",
        mbtype: model ? model.mbtype : 1,
        cjsj: model ? model.cjsj : "",
        GongZuoJiHuaNeiRongs: new SonGongZuoJiHuas(model)

    };
}
function SonGongZuoJiHuas(model) {
    var arr = [];
    if (model && model.GongZuoJiHuaNeiRongs) {
        $(model.GongZuoJiHuaNeiRongs).each(function (i, item) {
            arr.push(new songongzuojihua(item));
        });
    }
    return arr;
}
function GetJiaoZhiGongs(model) {
    var arr = [];
    if (model && model.RenYuanList) {
        $(model.RenYuanList).each(function (i, item) {
            arr.push(item);
        });
    }
    return arr;
}
function songongzuojihua(model) {
    return {
        nrid: model ? model.nrid : 0,
        gzjhsx: model ? model.gzjhsx : 0,
        nr: model ? model.nr : "",
        gzjhfz: model ? model.gzjhfz : 0,
        gzjhhtml: model ? model.gzjhhtml : "",
        isedit: model ? model.isedit : true,//true是可以自己填写，false只能通过其它功能填写
        KaoHeFanWeis: new KaoHeFanWeis(model),
        GongZuoJiHuaSons: new GetGongZuoJiHuaSon(model),
        RenYuanList: []
    };
}
function GetGongZuoJiHuaSon(model) {
    var arr = [];
    if (model && model.GongZuoJiHuaSons) {
        $(model.GongZuoJiHuaSons).each(function (i, item) {
            arr.push(new GongZuoJiHuaSon(item));
        });
    }
    return arr;
}
function GongZuoJiHuaSon(model) {
    return {
        gzjhsid: model ? model.gzjhsid : 0,
        gzjhssx: model ? model.gzjhssx : 0,
        gzjhsnr: model ? model.gzjhsnr : "",
        gzbz: model ? model.gzbz : "",
        gzjhsfz: model ? model.gzjhsfz : 0,
        gzjhshtml: model ? model.gzjhshtml : ""
    };
}
function KaoHeFanWeis(model) {
    var arr = [];
    if (model && model.KaoHeFanWeis) {
        $(model.KaoHeFanWeis).each(function (i, item) {
            arr.push(new KeShi(item));
        });
    }
    return arr;
}